/*
 * @Author: your name
 * @Date: 2020-05-14 22:24:32
 * @LastEditTime: 2020-11-02 23:20:42
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \cloudEdu\src\router\index.js
 */
import Vue from 'vue';
import VueRouter from 'vue-router';

// 路由数据
import routes from './routes';

Vue.use(VueRouter);
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}
// 导出路由 在 main.js 里使用
const router = new VueRouter({
    routes
});

/**
 * 路由拦截
 * 权限验证
 */
router.beforeEach((to, from, next) => {
    next();
});

export default router;
